import axios from "../utils/config"

// 获取订单
export const getOrderApi=(order_id)=>axios.post("/order/get_order")

// 获取产品
/**
 * 
 * @param {String} categoty_id 商品所在类目的id
 * @returns 
 */
export const getVipListApi=category_id=>axios.get("/product/get_product",{
    params:{
        category_id
    }
})

// 生成预支付订单 

export const preOrderApi=(product_id,quantity=1)=>axios.post("/order/pre_order",{
    product_id,
    quantity
})
//获取订单详情
export const getOrderDetailApi = order_id => axios.post("/order/get_order", {
    order_id
  })
  
  //发起支付
  
  export const getPayUrlApi = order_id => axios.post("/pay/payment", {
    order_id 
  })
  
  //查询支付结果 这个使用ajax轮询的方式查询状态
  
  export const queryPayResultApi = order_id => axios.get("/order/query_order_status", {
    params: {
      order_id
    }
  })